package UDP;

import java.io.IOException;
import java.net.SocketException;
import java.util.HashMap;
import java.util.Map;

public class dictionary extends server{
    Map<String,String>map=new HashMap<>();
    public dictionary(int port) throws SocketException {
        super(port);
        map.put("cat","小猫");
        map.put("dog","小狗");
        map.put("pig","小猪");
    }

    @Override
    public void startup() throws IOException {
        System.out.println("Dictionary is Running...");
        super.startup();
    }

    @Override
    public String process(String require) {
        return map.getOrDefault(require,"Is Not Found");
    }

    public static void main(String[] args) throws IOException {
        dictionary dictionary=new dictionary(9090);
        dictionary.startup();
    }
}
